// 前端权限对象
export const Func = {
  // 通用认证
  common: {},
  // 智能体
  assistant: {
    menu: 'assistant',
    query: 'applicationQuery',
    add: 'applicationAdd',
    edit: 'applicationEdit',
    configEdit: 'applicationConfigEdit',
    del: 'applicationDel',
    online: 'applicationOnline',
    offline: 'applicationOffline',
    detail: 'applicationDetail',
    dashboard: 'applicationDashboard'
  },
  // 提示词
  prompt: {
    menu: 'prompt',
    query: 'promptQuery',
    add: 'promptAdd',
    edit: 'promptEdit',
    del: 'promptDel',
    optimize: 'promptOptimize',
    recommend: 'promptRecommend'
  },
  // 知识库
  knowledge: {
    menu: 'knowledge',
    query: 'knowledgeQuery',
    add: 'knowledgeAdd',
    edit: 'knowledgeEdit',
    del: 'knowledgeDel',
    fileList: 'knowledgeFileList',
    fileUpload: 'knowledgeFileUpload', // 上传文件
    fileDel: 'knowledgeFileDel', // 删除文件
    tags: 'knowledgeTags' // 管理标签
  },
  // 插件
  tools: {
    menu: 'plugin',
    query: 'pluginQuery',
    add: 'pluginAdd',
    edit: 'pluginEdit',
    del: 'pluginDel',
    publish: 'pluginPublish',
    version: 'pluginVersion'
  },
  // 工作流
  workflow: {
    menu: 'workflow',
    query: 'workflowQuery',
    add: 'workflowAdd',
    edit: 'workflowEdit',
    del: 'workflowDel',
    publish: 'pluginPublish'
  }
}

/**
 * 前端权限码列表
 */
export const frontendPermissionList = [
  // { code: 'home', name: '首页', backendCode: '' },
  // { code: 'application', name: '智能体', backendCode: '' },
  // { code: 'prompt', name: '提示词', backendCode: '' },
  // { code: 'knowledge', name: '知识库', backendCode: '' },
  // { code: 'plugin', name: '插件', backendCode: '' },
  // { code: 'skills', name: '工作流', backendCode: '' },
  // 智能体
  { code: Func.assistant.menu, name: '百创智能体管理', backendCode: 'assistant_list' },
  { code: Func.assistant.query, name: '列表', backendCode: 'assistant_list' },
  { code: Func.assistant.add, name: '创建', backendCode: 'assistant_create' },
  { code: Func.assistant.edit, name: '编辑', backendCode: 'assistant_edit' },
  { code: Func.assistant.configEdit, name: '配置编辑', backendCode: 'assistant_edit' },
  { code: Func.assistant.del, name: '删除', backendCode: 'assistant_delete' },
  { code: Func.assistant.online, name: '上线', backendCode: 'assistant_publish' },
  { code: Func.assistant.offline, name: '下线', backendCode: 'assistant_offline' },
  { code: Func.assistant.detail, name: '详细', backendCode: 'assistant_detail' },
  { code: Func.assistant.dashboard, name: '数据看板', backendCode: 'assistant_detail' },

  // 提示词
  { code: Func.prompt.menu, name: '百创提示词管理', backendCode: 'prompt_list' },
  { code: Func.prompt.query, name: '列表', backendCode: 'prompt_list' },
  { code: Func.prompt.add, name: '创建', backendCode: 'prompt_create' },
  { code: Func.prompt.edit, name: '编辑', backendCode: 'prompt_edit' },
  { code: Func.prompt.del, name: '删除', backendCode: 'prompt_delete' },
  // { code: Func.prompt.optimize, name: '优化', backendCode: 'prompt_optimize' },
  // { code: Func.prompt.recommend, name: '推荐', backendCode: 'prompt_recommend' },

  // 知识库
  { code: Func.knowledge.menu, name: '百创知识库管理', backendCode: 'knowledge_list' },
  { code: Func.knowledge.query, name: '列表', backendCode: 'knowledge_list' },
  { code: Func.knowledge.add, name: '创建', backendCode: 'knowledge_create' },
  { code: Func.knowledge.edit, name: '编辑', backendCode: 'knowledge_edit' },
  { code: Func.knowledge.del, name: '删除', backendCode: 'knowledge_delete' },
  { code: Func.knowledge.fileUpload, name: '上传文件', backendCode: 'knowledge_upload' },
  { code: Func.knowledge.fileDel, name: '删除文件', backendCode: 'knowledge_delete_file' },
  { code: Func.knowledge.tags, name: '管理标签', backendCode: 'knowledge_label' },
  { code: Func.knowledge.fileList, name: '文件列表', backendCode: 'knowledge_file_list' },

  // 插件
  { code: Func.tools.menu, name: '百创插件管理', backendCode: 'tool_list' },
  { code: Func.tools.query, name: '插件列表', backendCode: 'tool_list' },
  { code: Func.tools.add, name: '创建', backendCode: 'tool_create' },
  { code: Func.tools.edit, name: '编辑', backendCode: 'tool_edit' },
  { code: Func.tools.del, name: '删除', backendCode: 'tool_delete' },
  { code: Func.tools.publish, name: '发布', backendCode: 'tool_publish' },
  { code: Func.tools.version, name: '版本控制', backendCode: 'tool_versions' },

  // 工作流
  { code: Func.workflow.menu, name: '百创工作流管理', backendCode: 'workflow_list' },
  { code: Func.workflow.query, name: '工作流列表', backendCode: 'workflow_list' },
  { code: Func.workflow.add, name: '创建', backendCode: 'workflow_create' },
  { code: Func.workflow.edit, name: '编辑', backendCode: 'workflow_update' },
  { code: Func.workflow.del, name: '删除', backendCode: 'workflow_delete' },
  { code: Func.workflow.del, name: '发布', backendCode: 'workflow_publish' }
]

// 后端权限返回示例
export const backendPermissionList = [
  'assistant',
  'assistant_create',
  'assistant_delete',
  'assistant_detail',
  'assistant_edit',
  'assistant_list',
  'assistant_offline',
  'assistant_publish',
  'assistant_dashboard',
  'knowledge',
  'knowledge_delete',
  'knowledge_func',
  'knowledge_list',
  'knowledge_upload',
  'prompt',
  'prompt_create',
  'prompt_delete',
  'prompt_edit',
  'prompt_list',
  'prompt_optimize',
  // 'prompt_recommend',
  'tool',
  'tool_list',
  'tool_create',
  'tool_delete',
  // 'tool_offline',
  'tool_publish',
  'tool_edit'
  // 'tool_versions'
]
